<%--
  User: 姚云鹏
  Date: 2018/6/11
  Time: 15:31
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
  <title>Title</title>
  <script src="/jquery-3.3.1.min.js"></script>
</head>
<body>
  <button onclick="f1();">发送并接收json数据</button>
</body>
<script>
  function f1(){
    $.ajax({
        url:"/json",
        type:"post",

        data:'{"brand":"apple","model":"Hsdqw2132-232","price":399.9}',
        contentType:"application/json",

        dataType:"json",
        success:function(data){
          console.log(data.brand);
        }

    });
  }

</script>
</html>
